<template>
	
    <div class="contentRight" style='margin-left: 200px;'>
    	<el-menu :default-active="activeIndex" class="el-menu-demo" mode="horizontal"  >
		  <el-menu-item index="1" @click.native="routeURl('/goods/library/libcontent')">商品库</el-menu-item>
		  <el-menu-item index="2" @click.native="routeURl('/goods/library/libtype')">商品分类</el-menu-item>
      </el-menu>

		<router-view></router-view>
		
    </div>
	        	
</template>

<script>
	export default{
	  data(){
	  	return{
	  		 activeIndex:'1',
	  	}
	  },

	  computed:{
	  	
		},
		mounted(){
         this.menuList()
		},
	  methods:{
       routeURl(path){
         this.$router.push({path:path})
			 },
			 menuList(){  
             let path = this.$route.path  
             if(path.indexOf('/libcontent') != -1){  
                this.activeIndex = '1'
                return this.activeIndex
              }
              if(path.indexOf('/libtype') != -1){
                  this.activeIndex = '2'
                  return this.activeIndex
              }
			 }      
	  }
	}
</script>

<style scoped>
 
</style>